#ifndef __CPIL_COUNTERMEMORYBLOCK_HPP__
#define __CPIL_COUNTERMEMORYBLOCK_HPP__

#include <exception.hpp>
#define COUNTER_MEMORY_BLOCK_SIZE 32

typedef unsigned int Counter;

class CounterMemoryBlock
{
    private:

        inline void initAllCounterFree();

    protected:

        Counter              data[COUNTER_MEMORY_BLOCK_SIZE];
        Counter            * nextFreeCounter;
        CounterMemoryBlock * next;

    public:

        CounterMemoryBlock();
        ~CounterMemoryBlock();
        CounterMemoryBlock(const CounterMemoryBlock &);
        CounterMemoryBlock& operator=(const CounterMemoryBlock &);

        Counter * newCounter();
        void      delCounter(Counter *);
};

#endif
